package com.tc.tickets.push;
//package main.java.com.tc.tickets.push;

import android.content.Context;
import android.net.ConnectivityManager;
import android.os.Looper;
import android.util.Log;
import android.widget.Toast;

import com.tc.tickets.push.Push;

/**
 * Created by Administrator on 2017/3/1.
 */
class PushDebugUtil {

    private static final boolean isDebug  = true;

    public static void v(String tag, String msg) {
        if (isDebug) {
            Log.v(tag, msg);
        }
    }

    public static void d(String tag, String msg) {
        if (isDebug) {
            Log.d(tag, msg);
        }
    }

    public static void i(String tag, String msg) {
        if (isDebug) {
            Log.i(tag, msg);
        }
    }

    public static void w(String tag, String msg) {
        if (isDebug) {
            Log.w(tag, msg);
        }
    }

    public static void e(String tag, String msg) {
        //无论什么时候，应该一直输出 错误信息
        Log.e(tag, msg);
    }

    public static void showToast(final Context context, final String toast){
        if (!isDebug){
            return;
        }

        new Thread(new Runnable() {
            @Override
            public void run() {
                Looper.prepare();
                Toast.makeText(context, toast, Toast.LENGTH_LONG).show();
                Looper.loop();
            }
        }).start();
    }


}
